package com.example.lin.customslidemenuview;

import android.support.v7.app.AppCompatActivity;
import android.os.Bundle;
import android.util.Log;

import com.example.lin.customslidemenuview.view.SlideMenuView;

public class MainActivity extends AppCompatActivity {

    private static final String TAG = MainActivity.class.getSimpleName();
    private SlideMenuView smv;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        smv = findViewById(R.id.smv);

        /**
         * 设置滑动菜单监听事件
         */
        smv.setOnSlideCallback(new SlideMenuView.OnSlideCallback() {

            @Override
            public void onOpen() {
                Log.d(TAG, "onOpen: 打开了");
            }

            @Override
            public void onClose() {
                Log.d(TAG, "onClose: 关闭了");
            }

            @Override
            public void onSlide(float slide, int pixel) {
                Log.d(TAG, "onSlide: " + slide + "," + pixel);
            }
        });
    }
}
